#pragma once
#include "PhysicObject.h"
#include "CannonBall.h"
#include "Event.h"
#include "GTimer.h"
#include "Bomb.h"
#include "TrackCoverTester.h"
#include "Sound.h"

class CustomModel;

class Car :
	public PhysicObject
{
public:
	Car(void);
	~Car(void);

	b2Vec2 speedVector;
	b2Vec2 applyPoint;

	const double hP;
	double force;

	bool accelerating;
	bool stearing;
	bool realoading;
	bool mineReloading;

	unsigned int trackCovered;
	unsigned int laps;

	GTimer reloadTimer;
	GTimer mineTimer;
	FatPointer<Car, void> *reloadPointer;
	FatPointer<Car, void> *minePointer;
	FatPointer<Car, void> *trackTestPointer;

	Sound engineSound;

	void stearLeft();
	void stearRight();
	void accelerate();
	void slowDown();
	void fireCannon();
	void placeMine();
	void reload(Event *e = NULL);
	void reloadMine(Event *e = NULL);
	void testTrackCovered(GameObject **a, GameObject **b);
	void update();

};
